package com.tengchao.books.model;

import org.springframework.cassandra.core.RowMapper;

import com.datastax.driver.core.Row;
import com.datastax.driver.core.exceptions.DriverException;

public class BookMapper implements RowMapper<Book>{

	public Book mapRow(Row row, int rowNum) throws DriverException {
		Book book = new Book();
		book.setBookid(row.getInt("bookid"));
		book.setAuthor(row.getString("author"));
		book.setPrice(row.getInt("price"));
		return book;
	}

}
